const { transform } = require('babel-core')

module.exports = function (script, cb) {
  this.cacheable()
  // 获取当前用户给当前loader传入的参数对象options

  let result = transform(script.content, {
    presets: [
      [
        'env', { 
          modules: false 
        }
      ]
    ]
  })

  cb(null, result.code)
}